<?php
/**
 * redis配置文件
 */
namespace app\common\config;

use think\Config;

use think\Env;

class RedisConfig
{
    //redis连接信息
    public $redis_host;
    //端口
    public $redis_port;
    //端口
    public $redis_passwd;
    /*
     *  文章点赞配置
     */
    //心情词库合集名
    public $collection = 'click_jf_mtyw_coll:';
    //哈希表前缀
    public $hashName = 'mtyw_calendar:';
    //每日添加数据合集
    public $collHashName = 'mtyw_calendar_hs:';
    //点赞量的队列名
    public $clickListName = 'mtyw_click_list:';
    //文章点赞量用户头像队列名
    public $clickImgListName = 'mtyw_click_img_l:';
    //用户头像队列名
    public $clickUserImgName = 'mtyw_user_img_l:';
    //点赞键名
    public $clickName = 'mtyw_click:';
    //点赞用户键名
    public $clickUserName = 'mtyw_click_user:';
    //点赞队列名
    public $clickQuenName = 'mtyw_click_quen:';
    //点赞总队列
    public $clickTotalName = 'mtyw_click_total:';
    //标记用户点赞 or 取消点赞
    public $clickSginUser = 'mtyw_sgin_click:';
    //用户点过赞的文章hash
    public $userClickAtr = 'mtyw_user_click_atr:';
    //点过赞的hash键名
    public $userAtr = 'mtyw_click_atr:';
    //保存点赞过的文章记录记录hash中
    public $clUserSave = 'mtyw_uscli_hs:';
    //缓存时间
    public $cacheTime;
    //近期浏览一周
    public $viewTime;
    //点赞每日过去昨天集合
    public $clickTime;
    /*
     *  专题关注配置
     */
    //专题关注队列名
    public $followListName = 'mtyw_follow_list:';
    //专题关注用户头像队列名
    public $followImgListName = 'mtyw_follow_img_list:';
    //用户头像队列名
    public $followUserImgName = 'mtyw_follow_user_name:';
    //关注键名
    public $followName = 'mtyw_follow:';
    //关注用户键名
    public $followUserName = 'mtyw_follow_user:';
    //关注队列名
    public $followQuenName = 'mtyw_follow_quen:';//follow
    //关注总队列
    public $followTotalName = 'mtyw_follow_total:';
    //标记用户关注 or 取消关注
    public $followSginUser = 'mtyw_sgin_follow:';
    //用户关注过的专题集合
    public $userFollowSp = 'mtyw_user_follow_sp:';
    //关注过的专题集合键名
    public $followSper = 'mtyw_follow_sp:';
    //保存关注过的文章记录记录hash中
    public $foUserSave = 'mtyw_usfol_hs:';
    /*
     *  文章浏览配置
     */

    //浏览量的队列名
    public $viewListName = 'mtyw_view_list:';
    //点赞键名
    public $viewName = 'mtyw_view:';
    //点赞总队列
    public $viewTotalName = 'mtyw_view_total:';
    //用户浏览过哪些文章键名
    public $userViewName = 'mtyw_user_view:';
    //点赞队集合
    public $viewQuenName = 'mtyw_view_quen:';
    //点赞队集合
    public $viewQuenJh = 'mtyw_view_jh:';
    //用户浏览过文章统计HASH表
    public $userViewQueName = 'mtyw_user_view_que:';

    public function __construct()
    {
        $this->redis_host = Env::get('redis.connection');
        $this->redis_port = Env::get('redis.port');
        $this->redis_passwd = Env::get('redis.password');
        $this->cacheTime = 5*168*3600;
        $this->clickTime = date('Ymd', time());
        $this->viewTime = 168*3600;
    }
}